using Agron.Data.Contracts;

using System;
using System.Collections.Generic;
using System.ServiceModel;


namespace Agron.Services.Contracts
{
    /// <summary>
    /// Defines the service-contract for the <c>Scheduler Service</c> service.
    /// </summary>
    [ServiceContract( Namespace = "http://services.udlap.mx/Agron/SchedulerService.svc")]
    public interface ISchedulerService
    {
        /// <summary>
        /// Creates a new session record in the data store.
        /// </summary>
        /// <param name="session">The <see cref="Session"/> data contract that will be created in the data store.</param>
        /// <exception cref="ArgumentNullException"><paramref name="session"/> is null.</exception>
        [OperationContract]
        void CreateSession(Session session);

        /// <summary>
        /// Deletes the specified session.
        /// </summary>
        /// <param name="sessionId">An <see cref="Int32"/> that uniquely specifies the session within the data store.</param>
        [OperationContract]
        void DeleteSession(int sessionId);

        /// <summary>
        /// Updates an existing session in the data store.
        /// </summary>
        /// <param name="session">The <see cref="Session"/> data contract that will be updated in the data store.</param>
        /// <exception cref="ArgumentNullException"><paramref name="session"/> is null.</exception>
        [OperationContract]
        void UpdateSession(Session session);

        /// <summary>
        /// Gets a <see cref="IEnumerable{Session}"/> collection of session objects owned by a specified user within a particular range.
        /// </summary>
        /// <param name="userId">A <see cref="Guid"/> that uniquely identifies the user within the datastore.</param>
        /// <param name="min">A <see cref="DateTime"/> value that specifies the minimum part of the date range.</param>
        /// <param name="max">A <see cref="DateTime"/> value that specifies the maximum part of the date range.</param>
        /// <returns>
        /// A <see cref="IEnumerable{Session}"/> collection of session objects owned by a specified user within a particular range.
        /// </returns>
        [OperationContract]
        IEnumerable<Session> GetRange(Guid userId, DateTime min, DateTime max);

        /// <summary>
        /// Gets a <see cref="Session"/> obeject from the datastore.
        /// </summary>
        /// <param name="sessionId">An <see cref="Int32"/> that uniquely specifies the session within the data store.</param>
        /// <returns>
        /// A <see cref="Session"/> obeject from the datastore or <c>null</c> if the session ID is invalid.
        /// </returns>
        [OperationContract]
        Session GetSessionInfo(int sessionId);
    }
}
